package person.tanjinfu.autorepository.repository;

import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;
import person.tanjinfu.autorepository.entity.Product;

import java.util.List;


@Repository
public interface IProductRepository extends MongoRepository<Product, String> {

    // the verbs(such as find, query ,delete) are defined in org.springframework.data.repository.query.parser.PartTree
    List<Product> findByCategoryId(String categoryId);

    void deleteByCategoryId(String categoryId);


}
